/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataConverters.interfaces.dataformulaobject.impl;

import DataConverters.interfaces.dataformulaobject.intefaces.CellType;
import DataConverters.interfaces.dataformulaobject.intefaces.FormulaCell;
import jxl.biff.formula.FormulaException;

/**
 *
 * @author Nobody
 */
public class CommonFormulaCell extends CommonDefaultCell implements FormulaCell {

    String formula;

    public CommonFormulaCell(int column, int row, CellType cellType, String formula) {
        super(column, row, cellType);
        this.formula = prepareFormula(formula);
    }

    private String prepareFormula(String formula) {
        return (!formula.startsWith("=")) ? "=" + formula : formula;
    }

    public String getFormula() {
        return formula;
    }

    public String getContents() {
        return formula;
    }
}
